<%@ page language="java" contentType="text/html; charset=EUC-KR"
    pageEncoding="EUC-KR"%>
<%@ page import="performReservation.SMMDBBean"%>
<%@ page import="java.sql.*"%>

<jsp:useBean id="cus" scope="page" class="performReservation.Customer"/>

<% request.setCharacterEncoding("euc-kr");%>

	<%
	String passwd=request.getParameter("password");
	String rPasswd = request.getParameter("cpassword");
	String name = request.getParameter("name");
	String address = request.getParameter("address");
	String nickName = request.getParameter("nickName");
	String email = request.getParameter("email");
	if(email== "" || passwd == "" || name == "" || nickName == ""|| address == ""){
		response.setHeader("Error","");
		out.println("Please fill the blank");
	}else if(!passwd.equals(rPasswd)){
		response.setHeader("Error","");
		out.println("confirm password!");
	}else{
		SMMDBBean mProcess = SMMDBBean.getInstance();
		cus.setEmail(email);
		cus.setName(name);
		cus.setNickname(nickName);
		cus.setPasswd(passwd);
		cus.setAddress(address);
		boolean b = mProcess.insertCustomer(cus);
		if(b){
		%>
		<jsp:forward page="login.jsp" />
	<%
		}else{
			response.setHeader("MYSQL Error","");
			out.println("unuseable Email!");
		}
	}
	%>
<!-- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
<title>...</title>
</head>
<body>
	
</body>
</html> -->